package Engine;

import static org.lwjgl.opengl.GL11.*;

import org.lwjgl.Sys;
import org.newdawn.slick.Color;
import org.newdawn.slick.opengl.Texture;

public abstract class RenderObject
{
    public abstract void RenderObject_init();
    public abstract void RenderObject_draw();
    
    public abstract void RenderObject_gui();
    
    public void DrawImage(Texture texture, int x, int y,  int Width, int Height, int zindex){

    	// draw quad
		
		
    	
				texture.bind();
		
		glPushMatrix();
			//glTranslatef(x, y, zindex);
			//glTranslatef(-x, -y, -zindex);
			glTranslatef(x, y, -zindex);
			glBegin(GL_QUADS);
				glTexCoord2f(0,0);
				glVertex2f(0,0);
				
				glTexCoord2f(1,0);
				glVertex2f(Width,0);
				
				glTexCoord2f(1,1);
				glVertex2f(Width,Height);
				
				glTexCoord2f(0,1);
				glVertex2f(0,Height);
				
			glEnd();
		glPopMatrix();
    }
    public void DrawColor(Color color, int x, int y,  int Width, int Height, int zindex){


		glPushMatrix();
		
			//glTranslatef(x, y, zindex);
			//glTranslatef(-x, -y, -zindex);
			glTranslatef(x, y, -zindex);
			glBegin(GL_QUADS);
				glColor4f(color.r, color.g, color.b, color.a);
				glVertex2f(0,0);
				
				glColor4f(color.r, color.g, color.b, color.a);
				glVertex2f(Width,0);
				
				glColor4f(color.r, color.g, color.b, color.a);
				glVertex2f(Width,Height);
				
				glColor4f(color.r, color.g, color.b, color.a);
				glVertex2f(0,Height);
				
			glEnd();
		glPopMatrix();
    }
    //abstract void onUpdate();
    //abstract void onDispose();
}
